package com.yangjun.utils.export;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Map;

public abstract class ExcelExportService implements IExportService {

	/**
	 * 获取Excel流
	 */
	public InputStream getInputStream(int tableFlag,Map<String,String> map) {
		ByteArrayOutputStream out = new ByteArrayOutputStream();
		putDataOnOutputStream(tableFlag, out,map);
		return new ByteArrayInputStream(out.toByteArray());
	}

	/**
	 * Excel写到流里面去
	 * 
	 * @param os
	 */
	protected abstract void putDataOnOutputStream(int tableFlag, OutputStream os,Map<String,String> map);
}

